package com.youlu.campus.entity.activity;

import lombok.Getter;

/**
 * 活动类型枚举类
 */
@Getter
public enum ActivityTypeEnum {

    JINSHUJU("jinshuju", "金数据"),
    CONTINUOUS_DAKA("continuous-daka", "连续打卡"),
    TIMETABLE("timetable", "课程表"),
    DAKA("daka", "活动打卡"),
    DOUYIN("douyin", "抖音"),
    QIMOBANG_VIDEO("qimobang-video", "期末帮视频活动"),
    PUBLICITY("publicity", "宣传类活动"),
    KOS("kos", "金山KOS"),
    RECRUITMENT("recruitment", "实习招聘"),
    WX_MINI_DREAMBEAT_CONTEST("wx-mini-dreambeat-contest", "微信小程序梦想跳动竞赛类"),
    VOTE("vote", "投票"),
    THIRD_VIDEO("third-video", "三方视频类"),
    VIDEO("video", "视频类"),
    BEFORE("before", "之前活动类型"),
    CONTEST_PLUS("contest-plus", "竞赛类"),
    H5_PLUS("h5-plus", "h5新版"),
    QQ_MINI_PLUS("qq-mini-plus", "小程序活动plus竞赛类"),
    QQ_MINI_PLUS_NONCONTEST("qq-mini-plus-noncontest", "小程序活动plus非竞赛类"),
    QQ_MINI_ZHONGQING_CONTEST("qq-mini-zhongqing-contest", "中青小程序活动竞赛类型"),
    QQ_MINI_ZHONGQING_NONCONTEST("qq-mini-zhongqing-noncontest", "中青小程序活动非竞赛类型"),
    H5_PLUS_PLUS("h5++", "新版H5,最终版"),
    READING("reading", "梦想跳动小程序读书类");

    /**
     * 类型标识
     */
    private final String type;

    /**
     * 描述信息
     */
    private final String desc;

    /**
     * 构造方法
     * @param type 类型标识
     * @param desc 描述信息
     */
    ActivityTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    /**
     * 根据类型标识获取枚举实例
     * @param type 类型标识
     * @return 对应的枚举实例，若不存在则返回null
     */
    public static ActivityTypeEnum getByType(String type) {
        for (ActivityTypeEnum activityType : values()) {
            if (activityType.getType().equals(type)) {
                return activityType;
            }
        }
        return null;
    }
}
    